﻿namespace breakoutsharp.utility
{
	using System;

	public static class FramerateMonitor
    {
        private static int framerate;
        private static int lastFramerate;
        private static int lastTick;

        public static int CalculateFramerate()
        {
            if (Environment.TickCount - lastTick >= 1000)
            {
                lastFramerate = framerate;
                framerate = 0;
                lastTick = Environment.TickCount;
            }

            framerate += 1;

            return lastFramerate;
        }
    }
}
